<!--
 * 介绍:
-->
<script lang="ts" setup>
import { useCrequestListRef } from "@@/components/common/CrequestList";
import { apiCommunityList, ApiCommunityList } from "@@/api/transaction/list";
import { omitText } from "@@/utils/tools/format";
import dayjs from "dayjs";

const CrequestListRef = useCrequestListRef<typeof apiCommunityList>();
interface ListSolt {
  item: ApiCommunityList.DataItem;
  index: number;
}
defineExpose({ CrequestListRef });
</script>
<template>
  <Ccard bg="var(--C-white-O3)" class="MT-lg">
    <VanDivider style="margin: 0 150rem">{{ $t("yao-qing-ji-lu") }}</VanDivider>
    <CrequestList
      :pull-refresh="false"
      ref="CrequestListRef"
      min-height="600rem"
      :api="apiCommunityList"
    >
      <template #item="{ item }: ListSolt">
        <Ccell class="T-S-sm gap-md" border-mode="bottom">
          <template #left>
            <BwkLevel :level="item.level" />
          </template>
          <template #center>
            <CcopyText class="T-nowrap" :copy-text="item.address">
              {{ omitText(item.address) }}
            </CcopyText>
          </template>
          <template #right>
            <div>
              {{ dayjs(item.created_at).format("YYYY-MM-DD HH:mm") }}
            </div>
          </template>
        </Ccell>
      </template>
    </CrequestList>
  </Ccard>
</template>
<style lang="scss" scoped></style>
